package com.android.antelopeapp.common;

/**
 * Created by phk on 2014/12/19.
 * 用于对前端数据的归一化
 */
public class Formater {
    public static String formatPrice(double price){
        //todo 价格格式需要统一
        if(price==(int)price){
            return "￥"+(int)price;
        }else {
            return "￥" + price;
        }
    }
    public static String formatCnt(int cnt){
        String ans="0";
        if(cnt>10000000){
            ans = cnt/10000000 +"kw";
        }
        else if(cnt>10000){
            ans =  cnt/10000+"w";
        }else if(cnt>1000){
            ans = cnt/1000+"k";
        }
        for(int i=ans.length();i<4;i++){
            ans = ans + " ";
        }
        return ans;
    }
}
